$(function () {
    $("#permission_datagrid").datagrid({
        fit:true,
        url:'/permission/list',
        rownumbers:true,
        singleSelect:true,
        pagination:true,
        checkOnSelect:true,
        fitColumns:true,
        toolbar:permission_datagrid_Btn,
        columns:[
            [
            {field:'name',title:'权限名称',align:'center',width:10},
            {field:'expression',title:'表达式',align:'center',width:10},
            ]
        ]
    })
})
//数据编辑===================================================================
function permission_reload(){
    var rowData = $("#permission_datagrid").datagrid("getSelected");
        $.messager.confirm('温馨提示','您需要进行加载数据吗？',function(yes){
            if(yes){
                $.post("/permission/reload="+rowData.id,function (data) {
                    if(data.success){
                        $.messager.alert("温馨提示",data.msg,"info",function () {
                            $("#permission_datagrid").datagrid("reload");
                        });
                    }else {
                        $.messager.alert("温馨提示",data.msg,"error");
                    }
                },"json");
            }
        });
}